package com.cms.framework.activity

import com.alibaba.android.arouter.facade.annotation.Route
import com.android.baselibrary.arouter.ArouterContains
import com.android.baselibrary.arouter.jumpActivity
import com.android.baselibrary.base.BaseActivity
import com.android.baselibrary.utils.GridSpaceItemDecoration
import com.cms.framework.R
import com.cms.framework.adapter.MainFrameWorkAdapter
import com.cms.framework.bean.RouteBeanUtils
import com.cms.framework.databinding.ActivityMainFrameworkBinding

/**
 * @author: Mr.You
 * @create: 2023-08-30 17:45
 * @description:
 **/
@Route(path = ArouterContains.FRAMEWORK)
class MainFrameWorkActivity:BaseActivity<ActivityMainFrameworkBinding>() {
    override fun getLayoutId(): Int = R.layout.activity_main_framework

    private val adapter: MainFrameWorkAdapter = MainFrameWorkAdapter()

    override fun initView() {
         mBinding.recycleView.addItemDecoration(GridSpaceItemDecoration(2,10))
         mBinding.recycleView.adapter = adapter
         adapter.setData(RouteBeanUtils.routes)
        adapter.setOnItemClickListener { data, _ ->
            jumpActivity(data.path)
        }

    }

    override fun initListener() {

    }
}